import React from "react";
import { Image, StyleSheet, Text, View } from "react-native";
import IconButton from "./IconButton";
import globalStyles from "@/common/styles/globalStyles";
import { router } from "expo-router";

export default function NavHeader(props: { navTitle: string }) {
	let { navTitle } = props;
	return (
		<View
			style={[
				globalStyles.rowLine,
				globalStyles.aiCenter,
				globalStyles.jcSB,
			]}
		>
			{/* 左侧返回键 */}
			<IconButton
				path={require("@/assets/common/chevron-left.png")}
				size={16}
				onPress={() => {
					router.back();
				}}
			/>
			<Text style={styles.navTitleText}> {navTitle} </Text>
			<View style={styles.backIcon}></View>
		</View>
	);
}

const styles = StyleSheet.create({
	backIcon: {
		width: 12,
		height: 12,
	},
	navTitleText: {
		fontWeight: "800",
		fontSize: 15,
	},
});
